/************************************************************
* @file gkt_dac.h
************************************************************/
#include "gkt_board.h"

#ifndef GKT_DAC_H
#define GKT_DAC_H

typedef enum {
	GKT_DAC_CONTROL_TYPE_FINISHED = 0,
	GKT_DAC_CONTROL_TYPE_STOP,

	GKT_DAC_CONTROL_TYPE_MAX
}gkt_dac_control_type_e;

typedef enum {
	GKT_DAC_PLAY_SWITCH_OPEN = 0,
	GKT_DAC_PLAY_SWITCH_CLOSE,
	GKT_DAC_PLAY_SWITCH_MAX,
}gkt_dac_play_switch_e;

typedef enum {
	GKT_DAC_START_MODE_SINGLE= 0,
	GKT_DAC_START_MODE_CYCLE,
	
	GKT_DAC_START_MODE_MAX
}gkt_dac_start_mode_e;

enum {
	GKT_DAC_VOICE_VOLUME_HIGH = 0,
	GKT_DAC_VOICE_VOLUME_MIDDLE = 1,
	GKT_DAC_VOICE_VOLUME_LOW = 2
};

typedef void (*gkt_dac_irq_fn)(void);

void gkt_dac_register_irq_callback(gkt_dac_irq_fn callback);
int gkt_dac_init(void);
void gkt_dac_start(uint32_t volume, const uint8_t *data, 
	uint32_t data_len, int mode, uint16_t water_level, uint8_t sample_multiple );
void gkt_dac_off(void);
void gkt_dac_control(gkt_dac_control_type_e type);
void gkt_dac_play_switch(gkt_dac_play_switch_e type);
void gkt_dac_reset_dma(uint8_t *dma_saddr, uint32_t data_len);
#endif

